libxc: Check full range of pfns for xc_dom_pfn_to_ptr
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Feb 2010 09:45:40 +0000 (09:45 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 3 Feb 2010 09:45:40 +0000 (09:45 +0000)
commit91e172bf6bc82d0f26564d545ef181d0d18ae1af
treec04d31f8633340a0d2130cf0cf7e9e13d299bd5a
parentada9d8c9f20850fb8730b60c04942cddf746a45f
libxc: Check full range of pfns for xc_dom_pfn_to_ptr

Previously, passing a valid pfn but an overly large count to
xc_dom_pfn_to_ptr, and functions which call it, would run off the end
of the pfn array giving undefined behaviour.

It is tempting to change this check to an assert, as no callers should
be providing invalid parameters here.  But this is probably best not
done while frozen for 4.0.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_dom_core.c